﻿using GameFramework.scene;
using GameFramework.UI;
using UnityEngine.UIElements;

namespace Game.ui
{
    [View(SceneViewManagerName = SceneViewManagerNames.Fight)]
    // [Presenter(type = typeof(Fight))]
    public class FightMainView:BaseView
    {
        [UIBind(ClassName = "exit")]
        private Label exitFight;

        public override void init()
        {
            base.init();
            elementRegisterCallBack<ClickEvent>(exitFight, e =>
            {
                //关闭结算界面，切换到主场景（跨场景，需要先显示跨场景加载界面）
                //切场景命令
                //TODO 场景管理器
                SceneLoadingManager.Instance.LoadingSceneWithLoadingUI("Home", () =>
                {
                    UIManager.Instance.switchSceneView(SceneViewManagerNames.Home);
                });

            });
        }
    }
}